package com.bwie.controller;

import com.bwie.pojo.Model;
import com.bwie.pojo.R;
import com.bwie.pojo.utile.Pageinfo;
import com.bwie.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DarkClown
 * @date 2024-07-24 14:07
 * @project_name hight5
 * @parem
 **/
@RestController
@RequestMapping("/mod/mod")
public class ModelController {
    @Autowired
    ModelService modelService;

    @RequestMapping("/modList")
    private R modList(@RequestBody Pageinfo pageinfo){
        return  modelService.selectlist(pageinfo);
    }

    @RequestMapping("/insert")
    private R insertList(@RequestBody Model model){
        return modelService.insertlist(model);
    }

    @RequestMapping("/saveOrUpdate")
    private R update(@RequestBody Model model){
         modelService.saveOrUpdate(model);
         return R.ok();
    }


}
